using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Simplify Line</para>
    /// <para>Simplifies lines by removing relatively extraneous vertices while preserving essential shape.</para>
    /// <para>通过删除相对无关的顶点来简化线条，同时保留基本形状。</para>
    /// </summary>    
    [DisplayName("Simplify Line")]
    public class SimplifyLine : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SimplifyLine()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input line features to be simplified.</para>
        /// <para>要简化的输入线功能。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The simplified output line feature class. It contains all fields present in the input feature class. The output line feature class is topologically correct. The tool does not introduce topology errors, but topological errors in the input data are flagged in the output line feature class. The output feature class includes two additional fields, InLine_FID and SimLnFlag, to contain the input feature IDs and the input topological errors, respectively. A SimLnFlag value of 1 indicates that an input topological error is present; a value of 0 (zero) indicates that no input error is present.</para>
        /// <para>简化的输出线要素类。它包含输入要素类中存在的所有字段。输出线要素类在拓扑上是正确的。该工具不会引入拓扑误差，但输入数据中的拓扑误会在输出线要素类中标记。输出要素类包括两个附加字段 InLine_FID 和 SimLnFlag，分别包含输入要素 ID 和输入拓扑误差。SimLnFlag 值为 1 表示存在输入拓扑错误;值为 0（零）表示不存在输入错误。</para>
        /// </param>
        /// <param name="_algorithm">
        /// <para>Simplification Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the line simplification algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Retain critical points (Douglas-Peucker)—Critical points that preserve the essential shape of a line are retained, and all other points are removed (Douglas-Peucker).This is the default.</bullet_item><para/>
        ///     <bullet_item>Retain critical bends (Wang-Müller)—Critical bends are retained, and extraneous bends are removed from a line (Wang-Müller).</bullet_item><para/>
        ///     <bullet_item>Retain weighted effective areas (Zhou-Jones)—Vertices that form triangles of effective area that have been weighted by triangle shape are retained (Zhou-Jones).</bullet_item><para/>
        ///     <bullet_item>Retain effective areas (Visvalingam-Whyatt)—Vertices that form triangles of effective area are retained (Visvalingam-Whyatt).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定行简化算法。</para>
        ///   <bulletList>
        ///     <bullet_item>保留临界点 （Douglas-Peucker） - 保留保留线的基本形状的临界点，并移除所有其他点 （Douglas-Peucker）。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>保留关键折弯 （Wang-Müller） - 保留关键折弯，并从线中移除无关折弯 （Wang-Müller）。</bullet_item><para/>
        ///     <bullet_item>保留加权有效面积 （周-Jones） - 保留形成已按三角形加权的有效面积三角形的顶点 （周-Jones）。</bullet_item><para/>
        ///     <bullet_item>保留有效面积 （Visvalingam-Whyatt） - 保留形成有效面积三角形的顶点 （Visvalingam-Whyatt）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_tolerance">
        /// <para>Simplification Tolerance</para>
        /// <para><xdoc>
        ///   <para>The tolerance determines the degree of simplification. You can choose a preferred unit; otherwise, units of the input will be used. The MinSimpTol and MaxSimpTol fields are added to the output to store the tolerance that was used when processing occurred.</para>
        ///   <bulletList>
        ///     <bullet_item>For the Retain critical points (Douglas-Peucker) algorithm, the tolerance is the maximum allowable perpendicular distance between each vertex and the new line created.</bullet_item><para/>
        ///     <bullet_item>For the Retain critical bends (Wang-Müller) algorithm, the tolerance is the diameter of a circle that approximates a significant bend.</bullet_item><para/>
        ///     <bullet_item>For the Retain weighted effective areas (Zhou-Jones) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices. The further a triangle deviates from equilateral, the higher weight it is given, and the less likely it is to be removed.</bullet_item><para/>
        ///     <bullet_item>For the Retain effective areas (Visvalingam-Whyatt) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>公差决定了简化的程度。您可以选择首选单位;否则，将使用输入的单位。MinSimpTol 和 MaxSimpTol 字段将添加到输出中，以存储发生处理时使用的容差。</para>
        ///   <bulletList>
        ///     <bullet_item>对于保留临界点 （Douglas-Peucker） 算法，容差是每个顶点与创建的新线之间允许的最大垂直距离。</bullet_item><para/>
        ///     <bullet_item>对于保留临界折弯 （Wang-Müller） 算法，公差是近似于有效折弯的圆的直径。</bullet_item><para/>
        ///     <bullet_item>对于保留加权有效面积 （周-Jones） 算法，公差的平方是由三个相邻顶点定义的有效三角形的面积。三角形偏离等边越远，赋予它的权重就越高，被移除的可能性就越小。</bullet_item><para/>
        ///     <bullet_item>对于保留有效面积 （Visvalingam-Whyatt） 算法，容差的平方是由三个相邻顶点定义的有效三角形的面积。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public SimplifyLine(object _in_features, object _out_feature_class, _algorithm_value _algorithm, string? _tolerance)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._algorithm = _algorithm;
            this._tolerance = _tolerance;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Simplify Line";

        public override string CallName => "cartography.SimplifyLine";

        public override List<string> AcceptEnvironments => ["MDomain", "XYDomain", "XYTolerance", "cartographicPartitions", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _algorithm.GetGPValue(), _tolerance, _error_resolving_option.GetGPValue(), _collapsed_point_option.GetGPValue(), _error_checking_option.GetGPValue(), _out_point_feature_class, _in_barriers];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input line features to be simplified.</para>
        /// <para>要简化的输入线功能。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The simplified output line feature class. It contains all fields present in the input feature class. The output line feature class is topologically correct. The tool does not introduce topology errors, but topological errors in the input data are flagged in the output line feature class. The output feature class includes two additional fields, InLine_FID and SimLnFlag, to contain the input feature IDs and the input topological errors, respectively. A SimLnFlag value of 1 indicates that an input topological error is present; a value of 0 (zero) indicates that no input error is present.</para>
        /// <para>简化的输出线要素类。它包含输入要素类中存在的所有字段。输出线要素类在拓扑上是正确的。该工具不会引入拓扑误差，但输入数据中的拓扑误会在输出线要素类中标记。输出要素类包括两个附加字段 InLine_FID 和 SimLnFlag，分别包含输入要素 ID 和输入拓扑误差。SimLnFlag 值为 1 表示存在输入拓扑错误;值为 0（零）表示不存在输入错误。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Simplification Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the line simplification algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Retain critical points (Douglas-Peucker)—Critical points that preserve the essential shape of a line are retained, and all other points are removed (Douglas-Peucker).This is the default.</bullet_item><para/>
        ///     <bullet_item>Retain critical bends (Wang-Müller)—Critical bends are retained, and extraneous bends are removed from a line (Wang-Müller).</bullet_item><para/>
        ///     <bullet_item>Retain weighted effective areas (Zhou-Jones)—Vertices that form triangles of effective area that have been weighted by triangle shape are retained (Zhou-Jones).</bullet_item><para/>
        ///     <bullet_item>Retain effective areas (Visvalingam-Whyatt)—Vertices that form triangles of effective area are retained (Visvalingam-Whyatt).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定行简化算法。</para>
        ///   <bulletList>
        ///     <bullet_item>保留临界点 （Douglas-Peucker） - 保留保留线的基本形状的临界点，并移除所有其他点 （Douglas-Peucker）。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>保留关键折弯 （Wang-Müller） - 保留关键折弯，并从线中移除无关折弯 （Wang-Müller）。</bullet_item><para/>
        ///     <bullet_item>保留加权有效面积 （周-Jones） - 保留形成已按三角形加权的有效面积三角形的顶点 （周-Jones）。</bullet_item><para/>
        ///     <bullet_item>保留有效面积 （Visvalingam-Whyatt） - 保留形成有效面积三角形的顶点 （Visvalingam-Whyatt）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplification Algorithm")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _algorithm_value _algorithm { get; set; }

        public enum _algorithm_value
        {
            /// <summary>
            /// <para>Retain critical points (Douglas-Peucker)</para>
            /// <para>Retain critical points (Douglas-Peucker)—Critical points that preserve the essential shape of a line are retained, and all other points are removed (Douglas-Peucker).This is the default.</para>
            /// <para>保留临界点 （Douglas-Peucker） - 保留保留线的基本形状的临界点，并移除所有其他点 （Douglas-Peucker）。这是默认设置。</para>
            /// </summary>
            [Description("Retain critical points (Douglas-Peucker)")]
            [GPEnumValue("POINT_REMOVE")]
            _POINT_REMOVE,

            /// <summary>
            /// <para>Retain critical bends (Wang-Müller)</para>
            /// <para>Retain critical bends (Wang-Müller)—Critical bends are retained, and extraneous bends are removed from a line (Wang-Müller).</para>
            /// <para>保留关键折弯 （Wang-Müller） - 保留关键折弯，并从线中移除无关折弯 （Wang-Müller）。</para>
            /// </summary>
            [Description("Retain critical bends (Wang-Müller)")]
            [GPEnumValue("BEND_SIMPLIFY")]
            _BEND_SIMPLIFY,

            /// <summary>
            /// <para>Retain weighted effective areas (Zhou-Jones)</para>
            /// <para>Retain weighted effective areas (Zhou-Jones)—Vertices that form triangles of effective area that have been weighted by triangle shape are retained (Zhou-Jones).</para>
            /// <para>保留加权有效面积 （周-Jones） - 保留形成已按三角形加权的有效面积三角形的顶点 （周-Jones）。</para>
            /// </summary>
            [Description("Retain weighted effective areas (Zhou-Jones)")]
            [GPEnumValue("WEIGHTED_AREA")]
            _WEIGHTED_AREA,

            /// <summary>
            /// <para>Retain effective areas (Visvalingam-Whyatt)</para>
            /// <para>Retain effective areas (Visvalingam-Whyatt)—Vertices that form triangles of effective area are retained (Visvalingam-Whyatt).</para>
            /// <para>保留有效面积 （Visvalingam-Whyatt） - 保留形成有效面积三角形的顶点 （Visvalingam-Whyatt）。</para>
            /// </summary>
            [Description("Retain effective areas (Visvalingam-Whyatt)")]
            [GPEnumValue("EFFECTIVE_AREA")]
            _EFFECTIVE_AREA,

        }

        /// <summary>
        /// <para>Simplification Tolerance</para>
        /// <para><xdoc>
        ///   <para>The tolerance determines the degree of simplification. You can choose a preferred unit; otherwise, units of the input will be used. The MinSimpTol and MaxSimpTol fields are added to the output to store the tolerance that was used when processing occurred.</para>
        ///   <bulletList>
        ///     <bullet_item>For the Retain critical points (Douglas-Peucker) algorithm, the tolerance is the maximum allowable perpendicular distance between each vertex and the new line created.</bullet_item><para/>
        ///     <bullet_item>For the Retain critical bends (Wang-Müller) algorithm, the tolerance is the diameter of a circle that approximates a significant bend.</bullet_item><para/>
        ///     <bullet_item>For the Retain weighted effective areas (Zhou-Jones) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices. The further a triangle deviates from equilateral, the higher weight it is given, and the less likely it is to be removed.</bullet_item><para/>
        ///     <bullet_item>For the Retain effective areas (Visvalingam-Whyatt) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>公差决定了简化的程度。您可以选择首选单位;否则，将使用输入的单位。MinSimpTol 和 MaxSimpTol 字段将添加到输出中，以存储发生处理时使用的容差。</para>
        ///   <bulletList>
        ///     <bullet_item>对于保留临界点 （Douglas-Peucker） 算法，容差是每个顶点与创建的新线之间允许的最大垂直距离。</bullet_item><para/>
        ///     <bullet_item>对于保留临界折弯 （Wang-Müller） 算法，公差是近似于有效折弯的圆的直径。</bullet_item><para/>
        ///     <bullet_item>对于保留加权有效面积 （周-Jones） 算法，公差的平方是由三个相邻顶点定义的有效三角形的面积。三角形偏离等边越远，赋予它的权重就越高，被移除的可能性就越小。</bullet_item><para/>
        ///     <bullet_item>对于保留有效面积 （Visvalingam-Whyatt） 算法，容差的平方是由三个相邻顶点定义的有效三角形的面积。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplification Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _tolerance { get; set; }


        /// <summary>
        /// <para>Resolve topological errors</para>
        /// <para>This is a legacy parameter that is no longer used. It was formerly used to indicate how topological errors, possibly introduced during processing, were resolved. This parameter is still included in the tool's syntax for compatibility in scripts and models but is hidden from the tool's dialog box.</para>
        /// <para>这是不再使用的旧参数。它以前用于指示如何解决在处理过程中可能引入的拓扑错误。此参数仍包含在工具的语法中，以便在脚本和模型中兼容，但在工具的对话框中隐藏。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Resolve topological errors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _error_resolving_option_value _error_resolving_option { get; set; } = _error_resolving_option_value._true;

        public enum _error_resolving_option_value
        {
            /// <summary>
            /// <para>RESOLVE_ERRORS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RESOLVE_ERRORS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>FLAG_ERRORS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FLAG_ERRORS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Keep collapsed points</para>
        /// <para><xdoc>
        ///   <para>Specifies whether an output point feature class will be created to store the endpoints of any lines that are smaller than the spatial tolerance. The point output is derived; it will use the same name and location as the Output feature class parameter but with a _Pnt suffix.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—A derived output point feature class will be created to store the endpoints of collapsed zero length lines. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—A derived output point feature class will not be created.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否创建输出点要素类来存储小于空间容差的任何线的端点。推导点输出;它将使用与输出要素类参数相同的名称和位置，但带有_Pnt后缀。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将创建派生输出点要素类以存储折叠零长度线的端点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会创建派生输出点要素类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep collapsed points")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _collapsed_point_option_value _collapsed_point_option { get; set; } = _collapsed_point_option_value._true;

        public enum _collapsed_point_option_value
        {
            /// <summary>
            /// <para>KEEP_COLLAPSED_POINTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_COLLAPSED_POINTS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_KEEP</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_KEEP")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Check for topological errors</para>
        /// <para>This is a legacy parameter that is no longer used. It was formerly used to indicate how topological errors, possibly introduced during processing, were handled. This parameter is still included in the tool's syntax for compatibility in scripts and models but is hidden from the tool's dialog box.</para>
        /// <para>这是不再使用的旧参数。它以前用于指示如何处理在处理过程中可能引入的拓扑错误。此参数仍包含在工具的语法中，以便在脚本和模型中兼容，但在工具的对话框中隐藏。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Check for topological errors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _error_checking_option_value _error_checking_option { get; set; } = _error_checking_option_value._true;

        public enum _error_checking_option_value
        {
            /// <summary>
            /// <para>CHECK</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CHECK")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_CHECK</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_CHECK")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Lines Collapsed To Zero Length</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Lines Collapsed To Zero Length")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_point_feature_class { get; set; }


        /// <summary>
        /// <para>Input Barrier Layers</para>
        /// <para>Inputs containing features to act as barriers for simplification. Resulting simplified lines will not touch or cross barrier features. For example, when simplifying contour lines, spot height features input as barriers ensure that the simplified contour lines will not simplify across these points. The output will not violate the elevation as described by measured spot heights.</para>
        /// <para>包含作为简化障碍的功能的输入。生成的简化线不会接触或跨越障碍要素。例如，在简化等值线时，将点高度要素输入作为障碍可确保简化的等值线不会在这些点上进行简化。输出不会违反测量的光斑高度所描述的高程。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Barrier Layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_barriers { get; set; } = null;


        public SimplifyLine SetEnv(object MDomain = null, object XYDomain = null, object XYTolerance = null, object cartographicPartitions = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, XYDomain: XYDomain, XYTolerance: XYTolerance, cartographicPartitions: cartographicPartitions, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}